<?php      
// Build horizontal menu
function build_menu() {
    global $pages;
    global $action;
    
    $menu = '<ul>';
    
    foreach ($pages as $pageName => $actionName) {        
        if ($actionName == $action || ($actionName == 'home' && $action == NULL)) {
            $menu .= "<li class=\"current\"><a href=\"index.php?action=$actionName\">$pageName</a></li>";            
        }

        else {
            $menu .= "<li><a href=\"index.php?action=$actionName\">$pageName</a></li>";
        } 
    }
    
    $menu .= '</ul>';
    return $menu;
}

// Get the clan logo
function get_clan_logo() {
    global $CLAN_LOGO;
    
    if ($CLAN_LOGO != '') {
        return $CLAN_LOGO; 
    }
    
    return './app/clan_name.php';
}        
?>

                <div class="Logo">Source.Donations</div>
                <div class="ClanLogo">
                    <img src="<?=get_clan_logo() ?>" alt="clan_logo" />
                    <?php if ($SERVER_IP != ''): ?>
                        <div class="ServerIP">
                            <a href="steam://connect/<?=$SERVER_IP ?>"><?=$SERVER_IP ?></a>
                        </div>
                    <?php endif; ?>
                </div>
                <div class="Menu">
                    <?=build_menu() ?>
                </div>

